package cn.wgx.module.mind.entity.mapper;

import cn.wgx.common.base.IBaseMapper;
import cn.wgx.common.entity.mind.ProjectUser;
import cn.wgx.common.entity.sys.SysUser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Select;

public interface ProjectUserMapper extends IBaseMapper<ProjectUser> {


    @Select("select s.user_id,s.username,s.nickname,s.photo,s.sex " +
            "from sys_user s " +
            "where user_id not in (select user_id from mind_pro_user where pro_id = #{pro_id}) "+
            " and user_id in (select user_id from ent_user where ent_id in (select ent_id from mind_project where pro_id = #{pro_id}))" +
            " and nickname like #{nickname}")
    <E extends IPage<SysUser>> E listUserNotInProject(E page, Integer pro_id, String nickname);

}
